#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include "abscences.h"
#include "personnel.h"
#include "sqldatabasedialog.h"
#include "saisieabs.h"


#include <QMessageBox>
#include <QDebug>

#include <QSqlError>
#include <QSqlDatabase>
#include <QSqlQuery>

#include <QCompleter>

namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void showVals();
    void getValues();
    void getRecords();
    void createCompleters();
    void enableNavigation(bool con);
    QString getCellValue(int r, int c);
    void setDb(QString dbName){db.setDatabaseName(dbName); }



private:
    Ui::MainWindow *ui;
    Dialog *abs;
    DialogAbs *b;
Personnel perso;
bool editMode;
QMap<QString, QVariant> m_connList,map;
QSqlDatabase db ;



public slots :
    void  dbConnect();
    void previous();
    void next();
    void print();
    void printTable(QString repFile);
    void setEdit(bool state);
    void newRec();

    void trier(QString field);

    void FindPersoSur();
    void del();
    void showAbs();
    void showPersonnel();
    void checkChanges(int row,int coloumn);
    void showFiche(QModelIndex index);
    void showSettings();
    void saisirAbs();

    void printAbsMois();
    void printAbsEmp();
    void printPayMois();
    void printPayEmp();


};

#endif // MAINWINDOW_H
